import request from "@/utils/request";
enum API {
  //获取已有的商品的数据
  SKU_URL = "/admin/product/list/",
  //上架
  ONSALE_URL = "/admin/product/onSale/",
  //下架
  CANCLESALE_URL = "/admin/product/cancelSale/",
  //商品详情
  DETAILS_URL = "/admin/product/getSkuInfo/",
  //删除
  REMOVESKU_URL = "/admin/product/deleteSku/",
}
//获取已有的商品的数据
export const reqSku = (page: number, limit: number) =>
  request.get<any, any>(API.SKU_URL + `${page}/${limit}`);
//上架
export const reqOnSale = (skuId: number) =>
  request.get<any, any>(API.ONSALE_URL + skuId);
//下架
export const reqCancleSale = (skuId: number) =>
  request.get<any, any>(API.CANCLESALE_URL + skuId);
//商品详情
export const reqDetails = (skuId: number) =>
  request.get<any, any>(API.DETAILS_URL + skuId);
//删除
export const reqRemoveSku = (skuId: number) =>
  request.delete<any, any>(API.REMOVESKU_URL + skuId);
